package entity.maintenance.dto;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import entity.maintenance.MaintenanceLevel;
import entity.maintenance.MaintenanceProgram;

public class MaintenanceLevelQueryWrapper {
    public QueryWrapper<MaintenanceLevel> conditional(MaintenanceLevel maintenanceLevel) {
        QueryWrapper<MaintenanceLevel> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("delete_flag", 0);
        if (maintenanceLevel.getLevelCoding() != null) {
            queryWrapper.like("level_coding", maintenanceLevel.getLevelCoding());
        }
        if (maintenanceLevel.getLevelName() != null) {
            queryWrapper.like("level_name", maintenanceLevel.getLevelName());
        }
        if (maintenanceLevel.getLevelState() != null) {
            queryWrapper.eq("level_state", maintenanceLevel.getLevelState());
        }
        if (maintenanceLevel.getLevelOperator() != null) {
            queryWrapper.like("level_operator", maintenanceLevel.getLevelOperator());
        }
        if (maintenanceLevel.getUpdateTime() != null) {
            queryWrapper.like("update_time", maintenanceLevel.getUpdateTime());
        }
        return queryWrapper;
    }
}
